/**
 * 可调用对象复制
 */

#include <iostream>
#include <thread>
#include <memory>

class Demo {
public:
    Demo() {
        std::cout << "create" << std::endl;
    }

    Demo(const Demo &d) {
        std::cout << "copy" << std::endl;
    }

    Demo(const Demo &&d)  noexcept {
        std::cout << "move" << std::endl;
    }

    ~Demo() {
        std::cout << "delete" << std::endl;
    }

    void operator()() {
        std::cout << "thread" << std::endl;
    }
};

int main() {
    Demo d;
    std::thread t(d);
    t.join();
    return 0;
}